import java.util.ArrayList;
import java.util.Scanner;

//线程类：计算整数序列和
class SumList extends Thread {
    private ArrayList lt = null;//存放整数序列的列表

    SumList(ArrayList lt) {
        this.lt = lt;
    }
    //线程体
    public void run() {
        int sum = 0;
        for (int i = 0; i < lt.size(); i++)
            sum += Integer.parseInt((String) lt.get(i));
        System.out.println(sum);
    }
}
public class Test10 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        for (int i = 0; i < n; i++) {
            ArrayList<Integer> score = new ArrayList<>();
            for (int j = 0; j < m; j++) {
                score.add(sc.nextInt());
            }
            SumList sl = new SumList(score);
            Thread th = new Thread(sl);//创建线程对象

            th.start();
//启动线程
        }
        sc.close();
    }
}